#include <curses.h>

int main()
{
    /*initscr();

    box(stdscr, ACS_VLINE, ACS_HLINE); //draw a box
    move(LINES/2, COLS/2); //move the cursor to the center
    waddstr(stdscr, "Hello, world!"); 
    refresh();
    getch();

    endwin();
    return 0;*/

    initscr();                                   //init screen
    if (start_color() == OK) {                   //enable color
        init_pair(1, COLOR_RED, COLOR_GREEN);    //create a pair of color
        attron(COLOR_PAIR(1));                   //enable output color of charactor
        move(LINES/2, COLS/2);
        waddstr(stdscr, "Yet another Hello, world!");
        attroff(COLOR_PAIR(1));                 //disable color display
        refresh();
        getch();
    }
    else {
        waddstr(stdscr, "Can not init color");
        refresh();
        getch();
    }
    endwin();                                   //close curses status
    return 0;
}
